package com.row.web.controller;

import com.row.common.utils.QRcodeUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName QRCodeController
 * @Description TODO
 * @Author Row
 * @Date 2019/6/18 10:02
 **/
@RestController
@RequestMapping("/qrcode")
public class QRCodeController {

    @GetMapping("/create")
    public void qrcode(HttpServletRequest request, HttpServletResponse response) throws Exception {

        //调用工具类，生成二维码
        QRcodeUtils.createQRCode("www.baidu.com", 180,180,response);   //180为图片高度和宽度
    }
}
